<?php
defined( '_VALID_MOS' ) or die( '非法链接.' );
require_once('common.inc.php');
require_once(_INC_PATH.'database.php');
require_once(_INC_PATH.'page.inc.php');
$db = new database();
$id = intval($_REQUEST['id']);
if($id <= 0)Location("/404.php");
$sql = "select * from tbl_corporation where del_flg=0 and id=$id";
$row = $db->loadRow($sql);
if(empty($row)){
	Location("/404.php");
}
$smarty->assign("name",$row['name']);
$smarty->assign("row",$row);
$pageinfo = Fetch("corporation_profile.tpl");

$dir = _CORPORATION_PATH;
if(!is_dir($dir))cMkDir($dir);
$dir = _CORPORATION_PATH.$id;
if(!is_dir($dir))cMkDir($dir);
writeFile($pageinfo, $dir.'/profile.html');
echo $pageinfo;
die;